import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//1.引入element-plus组件库与其样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//2.引入element-plus图标库，并起别名ElementPlusIconsVue
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)/* 创建Vue实例,并起名为app */
//3.将所有导入的图标组件变为键值对数组，并一次便利去除每一个图标组件[key,component]
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    //4.将当前遍历到的图表组件注册为当前Vue实例的全局组件
    app.component(key, component)
}
//5.为当前Vue实例添加element-plus组件库与其他配置项，最后挂载到app元素上
app.use(ElementPlus).use(store).use(router).mount('#app')
